{% extends "cms/cms_book.html" %}

{% block title %}
    <title>新增图书</title>
{% endblock %}

{% block book_body %}
    <h5 class="text-center">新书入馆</h5>
    <form method="post">
          <div class="form-group">
            <label for="input_book_name">图书名</label>
            <input type="text" class="form-control" name="name" id="input_book_name" >
          </div>
          <div class="form-group">
            <label for="input_author">作者</label>
            <input type="text" class="form-control" name="author_name" id="input_author">
          </div>
          <div class="form-group">
            <label for="text_area">图书简介</label>
            <textarea class="form-control" id="text_area" name="desc" rows="3"></textarea>
          </div>
          <div class="form-group">
            <label for="board-select">分类</label>
            <select class="form-control" id="board-select" name="board_id">
                {% for board in boards %}
                    <option value="{{ board.id }}">{{ board.name }}</option>
                {% endfor %}
            </select>
          </div>
      <button type="submit" class="btn btn-primary">提交</button>
</form>
    <ul>
    {% for mes in get_flashed_messages() %}
        <li>{{ mes }}</li>
    {% endfor %}
    </ul>
{% endblock %}